﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Saker.Kernel.Model;

namespace Saker.Kernel.BLL
{
    public class AdminBase : BasePager
    {
        /// <summary>
        /// 管理员
        /// </summary>
        protected SysUser user = null;


        #region 重载方法
        /// <summary>
        /// 重载Load方法
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoad(EventArgs e)
        {

            //判断用户是否过期
            string username = "SakerAdmin";
            if (Session[username] == null)
            {
                Response.Redirect("/Boss/Login.aspx");
            }
            else
            {
                user = (SysUser)Session[username];
                if (user.IsLimit)
                {
                    Response.Redirect("/Admin/Message.aspx?message=您的帐号已被锁定，请尽快与管理员联系！" + "&z=no");
                }
                else
                {
                    //写出客户端
                    //string spower = Request.QueryString["a"] == null ? "" : Request.QueryString["a"].Trim();
                    //string powercode = this.ToString();
                    //if (spower == "powercode")
                    //{
                    //    Response.Write(HtmlLabel.powerCode + powercode + HtmlLabel.powerCode);
                    //    Response.End();
                    //}
                }
            }
            base.OnLoad(e);
        }


        /// <summary>
        /// 初始化
        /// </summary>
        /// <param name="e"></param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }

        /// <summary>
        /// 重载OnPreRender方法
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
        }

        /// <summary>
        /// 卸载页面
        /// </summary>
        /// <param name="e"></param>
        protected override void OnUnload(EventArgs e)
        {
            base.OnUnload(e);
        }

        #endregion
    }
}
